package com.itheima.health.service;

import com.itheima.health.entity.PageResult;
import com.itheima.health.entity.QueryPageBean;
import com.itheima.health.pojo.CheckItem;
import com.itheima.health.pojo.Member;
import com.sun.org.glassfish.gmbal.Description;
import com.sun.xml.internal.bind.v2.TODO;

import java.util.List;
import java.util.Map;

public interface MemberService {
    /**
     * 添加会员
     * 不存在则创建并返回，存在则更新非空字段并返回
     * @param member
     * @return
     */
    Member addIsNotEx(Member member);

    /**
     * 根据ID查询
     * @param id
     * @return
     */
    Member findById(Integer id);

    /**
     * 获取月份列表的会员数量
     * @param monthList 月份列表
     * @return
     */
    List<Integer> countByMonth(List<String> monthList);
    /**
     * 统计套餐预约数量
     * 返回值格式：
     * [{"name":"xxxx套餐"，"value":订单数量}]
     * @return
     */
    List<Map<String,Object>> countBySex();

    /**
     * @Author: lenovo
     * @Date: 15:08 2021/3/11
     * @Parms []
     * @ReturnType: java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
     * @Description: 通过年龄段统计会员饼状图
     */
    List<Map<String, Object>> countByAgeRange();

    /**
     * @Author: lenovo
     * @Date: 14:09 2021/5/10
     * @Parms [queryPageBean]
     * @ReturnType: com.itheima.health.entity.PageResult
     * @Description: 分页查询
    */
    PageResult findPage(QueryPageBean queryPageBean);

    /**
     * @Author: lenovo
     * @Date: 14:11 2021/5/10
     * @Parms [member]
     * @ReturnType: void
     * @Description: 添加会员
    */
    void add(Member member);

    /**
     * @Author: lenovo
     * @Date: 14:11 2021/5/10
     * @Parms [id]
     * @ReturnType: void
     * @Description: 删除会员
    */
    void delete(Integer id);

    /**
     * @Author: lenovo
     * @Date: 14:11 2021/5/10
     * @Parms [member]
     * @ReturnType: void
     * @Description: 编辑会员
    */
    void edit(Member member);

    /**
     * @Author: lenovo
     * @Date: 14:11 2021/5/10
     * @Parms []
     * @ReturnType: java.util.List<com.itheima.health.pojo.Member>
     * @Description: 查询所有
    */
    List<Member> findAll();

    /**
     * @Author: lenovo
     * @Date: 16:17 2021/5/14
     * @Parms []
     * @ReturnType: com.itheima.health.pojo.Member
     * @Description: 根据手机号查会员
    */
    Member findByTele(String tele);
}
